home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10556 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: camelot.dsccc.com!not-for-mail
  2. From: kcline@sun152.spd.dsccc.com (Kevin Cline)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Date: 8 Mar 1996 10:57:21 -0600
  6. Organization: DSC Communications Corporation Switch Products Division
  7. Message-ID: <4hpoth$6uo@sun152.spd.dsccc.com>
  8. References: <00001a73+00002504@msn.com> <4h5hgj$vpd@tomquartz.niestu.com> <4h7jskINNnph@anvil.ugrad.cs.ubc.ca> <313EDF38.61C1@lfwc.lockheed.com>
  9. NNTP-Posting-Host: sun152.spd.dsccc.com
  10.  
  11. In article <313EDF38.61C1@lfwc.lockheed.com>,
  12. Ken Garlington  <GarlingtonKE@lfwc.lockheed.com> wrote:
  13.  >Kazimir Kylheku wrote:
  14.  >> I bet I could get a Fortran programmer to write Ada code that
  15.  >> looks like Ada but is really Fortran in disguise. :)
  16.  >
  17.  >Except - it would not have the aliasing errors of FORTRAN common blocks,
  18.  >for example.
  19.  >
  20.  
  21. That is a very old Fortran programmer error, virtually eliminated when the
  22. INCLUDE statement became widely supported and it was easy to ensure that
  23. all modules had consistent COMMON block definitions.
  24.  
  25. The modern Fortran programmer using Ada would put all the data in
  26. a package named 'GLOBALS'.  There would be no aliasing problems, but
  27. huge problems due to lack of encapsulation.
  28.  
  29. Of course, in C or C++ the programmer would create a file 
  30. "globals.h" with extern declarations for all the data.  A somewhat more 
  31. sophisticated programmer would have a singleton class named Global with
  32. set and get methods for all the data.
  33. -- 
  34. Kevin Cline
  35.